using UnityEngine;
using System.Collections;

public class ChairSprite : MonoBehaviour {
    private OTAnimatingSprite sprite;
    private int frameIndex;
	public int HoverFrame;
    public int Seat;
	// Use this for initialization
	void Start () {

        sprite = this.GetComponent<OTAnimatingSprite>();

        sprite.onMouseEnterOT = delegate(OTObject owner)
        {
            frameIndex = sprite.frameIndex;
            sprite.frameIndex = HoverFrame;
        };
        sprite.onMouseExitOT = delegate(OTObject owner)
        {
            sprite.frameIndex = frameIndex;
        };
        sprite.onInput = delegate(OTObject owner)
        {
            BlackJackController.Join(this.Seat);
        };
	}
	
	// Update is called once per frame
	void Update () {
		
	}
}
